package com.txt.config;

import com.txt.interceptor.TxtInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new TxtInterceptor())
                .excludePathPatterns(//业务放行
                        "/user/login/**")
                .excludePathPatterns(//文档放行
                        "/doc.html/**",
                        "/v3/api-docs/**",
                        "/webjars/**",
                        "/swagger-ui.html",
                        "/swagger-ui/**",
                        "/swagger-resources/*")
                .addPathPatterns("/user/**");//拦截url
    }


}
